Type a number
The first statement is an ordinary PRINT statement that writes a string to the monitor.
' Double a Number ' PRINT "Type a number" 'Ask the user for a number INPUT NUMBER 'Get it from the keyboard, put it in NUMBER PRINT NUMBER * 2 'Print the number times two. END
Now the second statement INPUT NUMBER
executes.
The INPUT
statement is used to get data from the keyboard.
It will:
Just after this statement starts the monitor will look something like:
Type a number ?
The question mark came from the INPUT
statement.
The INPUT
statement is waiting for the user (you) to
type a number. Say that you type 23. Now the monitor
looks like:
Type a number ? 23
To enter the number, hit the enter key.
The INPUT
statement puts the 23 into the variable
NUMBER.
Next, the PRINT
statement executes.
What will the monitor finally look like?